<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>内置组件 -slot讲解</title>
  <script src="../assets/js/vue.js"></script>
</head>

<body>
  <h1>内置组件 -slot讲解</h1>
  <hr>
  <div id="app">
   <sunday>
     <span slot="blogUrl">{{sundayData.blogUrl}}</span>
     <span slot="netName">{{sundayData.netName}}</span>
     <span slot="skill">{{sundayData.skill}}</span>
   </sunday>
  </div>

  <template id="tep">
    <div>
      <p>博客地址:<slot name="blogUrl"></slot></p>
      <p>昵称:<slot name="netName"></slot></p>
      <p>技能:<slot name="skill"></slot></p>
    </div>
  </template>

  <script type="text/javascript">
  var sunday={
    template:"#tep"
  }
    var app = new Vue({
      el: '#app',
      data: {
        sundayData:{
          blogUrl:'http://isundayweb.com',
          netName:'Sunday',
          skill:'web前端'
        }
      },
      components:{
        "sunday": sunday
      }
    })
  </script>
</body>

</html>